package ys.ewp.po;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @description 员工PO
 */
@Entity
@Table(name="tb_employee")
public class Employee extends BasePo {
	/**
	 * 部门经理
	 */
	public static final String DEPMANAGER = "部门经理";
	/**
	 * 管理员
	 */
	public static final String MANAGER = "管理员";
	/**
	 * 普通员工
	 */
	public static final String EMPLOYEE = "普通员工";
	
	//员工姓名
	private String realName;
	//员工性别
	private String sex;
	//手机
	private String mobile;
	//邮箱
	private String email;
	//备注
	private String remark;
	
	//所属部门
	private Department department;
	
	//职位（默认为普通员工）
	private String position = EMPLOYEE;
	
	//用户自定义字段列表
	private List<UserField> userFieldList;
	
	public String getRealName() {
		return realName;
	}
	public void setRealName(String realName) {
		this.realName = realName;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	@ManyToOne
	@JoinColumn(name="department_id")
	public Department getDepartment() {
		return department;
	}
	public void setDepartment(Department department) {
		this.department = department;
	}
	
	public String getPosition() {
		return position;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	
	@OneToMany(mappedBy = "employee", cascade = CascadeType.REMOVE)
	public List<UserField> getUserFieldList() {
		return userFieldList;
	}
	public void setUserFieldList(List<UserField> userFieldList) {
		this.userFieldList = userFieldList;
	}
	
}
